package mybatis.controller;

import mybatis.bean.Employee;
import mybatis.service.EmployeeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;
import java.util.Map;

/**
 * @BelongsProject: mybatis_demos
 * @BelongsPackage: mybatis.controller
 * @Author: LiYing
 * @CreateTime: 2021-01-12 10:50
 * @Description:
 */

@Controller
public class EmployeeController {

    @Autowired
    EmployeeService employeeService;

    @RequestMapping("/getemps")
    public String emps(Map<String,Object> map){

        List<Employee> emps = employeeService.getEmps();
        map.put("allEmps", emps);

        return "list";

    }

}

